# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=trid
pkgver=2.24
pkgrel=6
pkgdesc='An utility designed to identify file types from their binary signatures.'
arch=('x86_64')
groups=('blackarch' 'blackarch-forensic' 'blackarch-binary')
url='http://mark0.net/soft-trid-e.html'
license=('custom:unknown')
depends=('trid-defs' 'lib32-ncurses')
source=("https://mark0.net/download/trid_linux_64.zip")
sha512sums=('8ff64d41580ce911d95274609926afcb8d6c95e3fb5ecd0f2922cbb0103c99d0b826d124941e2792730d33e520f0e971288c8a6dc57c195d4cbb124870a315c1')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 $pkgname "$pkgdir/usr/share/$pkgname/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" readme.txt

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec /usr/share/$pkgname/$pkgname -d:/usr/share/$pkgname/triddefs.trd "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

